home *** CD-ROM | disk | FTP | other *** search
/ Utilities Professional 1-1500 / Utilities Professional 1-1500 (1994)(WPD)[!].iso / 12511500 / var1308.dms / var1308.adf / DNET_SNF.LHA / src / snfs.c-patch
Internet Message Format  |  1992-11-22  |  3KB

  1. From d88-skl@nada.kth.se Sun Sep 29 01:14:45 1991
  2. From: d88-skl@nada.kth.se (Stellan Klebom)
  3. Newsgroups: comp.sys.amiga.datacomm
  4. Subject: Re: DNet 2.20 snfs & nfs-handler
  5. Date: 18 Sep 91 03:48:29 GMT
  6. Reply-To: d88-skl@nada.kth.se (Stellan Klebom)
  7. Organization: Royal Institute of Technology, Stockholm, Sweden
  8.  
  9. In article <432469974@bluemoon.GUN.de>, georg@bluemoon.GUN.de (Georg Sassen) writes:
  10. |> In <91256.10163932KKG6I@CMUVM.BITNET> 32KKG6I@CMUVM.BITNET (Jim Getzinger) writes:
  11. |> 
  12. |> >Has anyone been able to make the nfs handler and snfs work on a Sun
  13. |> >Sparc?   I'm able to start snfs in the background and successfully
  14. |> >mount NF0: (or NFS:) but when I do a dir on NF0:, all I get is one
  15. |> >directory entry.  When it is at the root, I get lost+found only.
  16. |> 
  17. |> Yes, there was a problem with alignement of a struct's entries, I think.
  18. |> 
  19. |> >I could not get the snfs.c in the normal dist to connect, but the version
  20. |> >I found at the dnet/. level allowed the connect, but would give me
  21. |> >the above problem.
  22. |> 
  23. |> Yes, in the snfs.c at the dnet/. level, the alignement problem was fixed but
  24. |> something other went wrong.
  25. |> 
  26. |> >Any suggestions?  Thanks in advance!
  27. |> 
  28. |> Try this one (apply it to the origininal snfs.c in dnet/unix/server), it
  29. |> works fine for me:
  30.  
  31. I found that the original dnet/unix/server/snfs.c worked fine on sun3. The
  32. snfs.c at dnet/snfs.c works fine under Ultrix. The problem with dnet/snfs.c
  33. is the lton and ntol funktions. They aren't portable between different
  34. endian systems. For suns they can be replaced with null macros. I have
  35. rewritten the functions to find which endian the excuting machines has, so
  36. that the code works in both cases. Replace the two functions in the end of
  37. the file, and compile! :)
  38.  
  39.          Have fun!
  40.  
  41.  
  42.       Stellan Klebom
  43.  
  44. -----------------------------------------------------------------------------
  45. E-Mail: d88-skl@nada.kth.se, meLazy@lysator.liu.se, melazy@stacken.kth.se
  46.  
  47.  
  48. *****************************************************************************
  49. long
  50. ntol(n)
  51. unsigned long n;
  52. {
  53.     union { unsigned long l; unsigned char b[4];} u;
  54.     unsigned char z;
  55.  
  56.     u.l=1;
  57.     if (u.b[0]) {
  58.         u.l = n;
  59.         z = u.b[0]; u.b[0] = u.b[3]; u.b[3] = z;
  60.         z = u.b[1]; u.b[1] = u.b[2]; u.b[2] = z;
  61.  
  62.         return u.l;
  63.     }
  64.  
  65.     return n;
  66. }
  67.  
  68. long
  69. lton(n)
  70. unsigned long n;
  71. {
  72.     union { unsigned long l; unsigned char b[4];} u;
  73.     unsigned char z;
  74.  
  75.     u.l=1;
  76.     if (u.b[0]) {
  77.         u.l = n;
  78.         z = u.b[0]; u.b[0] = u.b[3]; u.b[3] = z;
  79.         z = u.b[1]; u.b[1] = u.b[2]; u.b[2] = z;
  80.  
  81.         return u.l;
  82.     }
  83.  
  84.     return n;
  85. }
  86.  
  87.  
  88.  
  89.